yno=2;
days1=21;
days2=7;
resall=zeros(days1+days2+1,29,3);
Analysis_v8_update; %green and brown bond
resall(:,:,1:2)=res(:,:,[2 1]); %2=black,1=wey
Analysis_v7_update; %all bonds
resall(:,:,3)=res(:,:,1);  %all bonds
res=resall;

nocar=length(res(1,1,:));
per=[days1+1 days1;days1+4 days1;days1+4 days1-6];
countries=3;

CAR=zeros(countries,length(per(:,1)),3,nocar);
for c=1:countries
    for i=1:nocar
        if c==1
            ind=1:length(res(1,:,1));
            txt{1}='All';
        elseif c==2
            ind=1:8; %Danish bonds
            txt{2}='Denmark';
       else 
            ind=9:length(res(1,:,1));
            txt{3}='Germany';
        end
        no(i)=length(ind);
        for j=1:length(per(:,1))
            CAR1=res(per(j,1),ind,i)-res(per(j,2),ind,i);
            CAR(c,j,1,i)=mean(CAR1);
            CAR(c,j,2,i)=sqrt(var(CAR1)/length(CAR1));
            CAR(c,j,3,i)=length(CAR1);
        end
    end
end
clear CARtxt; CARtxt{1}='CYR(0)'; CARtxt{2}='CYR(0,3)'; CARtxt{3}='CYR(-6,3)'; 


qq=norminv([0.95 0.975 0.995]);
prec0='%11.0f'; prec1='%11.1f'; prec2='%11.2f';
str='\begin{table}[h]\begin{center}\begin{tabular}{lccccccccc} \hline ';
str=[str ' & \multicolumn{3}{l}{\underline{All}} & \multicolumn{3}{l}{\underline{Denmark}} & \multicolumn{3}{l}{\underline{Germany}} \\ '];
for i=1:3, str=[str '& Standard & Pair & All']; end; str=[str '\\'];
for i=1:length(CARtxt)
    str=[str CARtxt{i}];
    for c=1:countries
        for j=1:nocar
            str=[str '&$' num2str(CAR(c,i,1,j),prec2) '^{'];
            for u=1:length(qq), if abs(CAR(c,i,1,j)/CAR(c,i,2,j))>qq(u), str=[str '*']; else end; end  
            str=[str '}$'];
        end
    end
    str=[str '\\'];
    for c=1:countries
        for j=1:nocar
            str=[str '&\begin{scriptsize}(' num2str(CAR(c,i,2,j),prec2) ')\end{scriptsize} '];
        end
    end
    str=[str '\\'];   
end
str=[str ' N '];
for c=1:countries
    for j=1:nocar
        str=[str '&' num2str(CAR(c,i,3,j))];
    end
end
str=[str '\\\hline \end{tabular}\end{center}'];
str

